# firewallstatus
# Builds from https://github.com/puppylinux-woof-CE/petbuilds
# File auto generated by ./mk_petbuild.sh. Edit as necessary.

. ../func
. ../build.conf

URL=http://distro.ibiblio.org/puppylinux/sources/f
PKG=firewallstatus
VER=0.7
COMP=tar.bz2
DESC="firewall status tray monitor"
DEPS=
CAT=BuildingBlock
DESKTOP=firewallstatus.desktop
BUILD=
CWD=$(pwd)
[ -z "$MWD" ] && MWD=$(dirname $CWD)
[ -z "$BUILD" ] && BUILD=$DEF_BUILD
# comment these 2 below if you use a custom package() function
#[ -f "$DESKTOP" ] || DESKTOP=not
#[ -z "$DEPS" ] && DEPS=not

ARCH=$(uname -m)
case $ARCH in # set in build.conf
 *64) 	LIBDIR=$LIBCONF64 ;;
 arm*)	LIBDIR=$LIBCONFarm;;
 *) 	LIBDIR=$LIBCONF32 ;;
esac

build() {
	cd firewallstatus*
	make || exit 1
	make DESTDIR=${CWD}/${PKG}-install install_min
	mkdir -p ${CWD}/${PKG}-install/root/.config/autostart
	mkdir -p ${CWD}/${PKG}-install/usr/src/dev/
	cp -af $DESKTOP ${CWD}/${PKG}-install/root/.config/autostart/
	cd -
}

package() {
	cat ${PKG}.petbuild > ${PKG}-install/usr/src/dev/${PKG}-build-recipe
	
	# split
	get_files ${PKG}-install ${PKG}-${VER}-${ARCH}_${BUILD}
	(cd ${PKG}-${VER}; $MWD/split.sh ../${PKG}-install $BUILD)
	for p in $(ls|grep "\-${ARCH}"|grep -v "files$") ; do
		case $p in
			*_DEV*) DESC="$PKG development"; DEPS=+${PKG} ;;
			*_DOC*) DESC="$PKG documentation"; DEPS=+${PKG} ;;
			*_NLS*) DESC="$PKG locales"; DEPS=+${PKG} ;;
		esac	
		echo "packaging $p"	
		dir2pet -x -s -w="$DESC" -d="$DEPS" -c="$CAT" -p=${p} 2>&1 >/dev/null
		rm -r $p
		mv ${p}.pet ../0pets_out/
	done
	rm -r ${PKG}-install
	rm -f ${PKG}-${VER}/${PKG}
	mv -f *.files ../0logs/
	echo "done!"
}

# main
#retrieve ${PKG}-${VER}.${COMP}
#extract ${PKG}-${VER}.${COMP}
build
package
